(use-package evil-leader :ensure t
  :config
  (global-evil-leader-mode)
  (evil-leader/set-leader "<SPC>")
  )

(use-package evil :ensure t
  :config
  (evil-mode 1)
  )



(define-key evil-normal-state-map (kbd "j") 'evil-next-visual-line)
(define-key evil-normal-state-map (kbd "k") 'evil-previous-visual-line)
(define-key evil-normal-state-map (kbd "C-u") 'evil-scroll-up)
(define-key evil-insert-state-map (kbd "C-y") 'yank)


(evil-leader/set-key
  "0" 'execute-extended-command
  "xz" 'suspend-frame
  "xf" 'counsel-find-file
  "x0" 'delete-winodw
  "bb" 'ivy-switch-buffer
  "dd" 'dired-jump
  "xo" 'other-window
  "ww" 'other-window
  "i" 'xah-open-file-at-cursor
  "1" 'delete-other-windows
  "2" 'split-window-below
  "3" 'split-window-right
  "4" 'evil-end-of-line
  "7" 'xah-new-empty-buffer
  "xe" 'eval-last-sexp
  "xs" 'save-buffer
  "xx" 'counsel-M-x
  "xr" 'recentf-open-files
  "zz" 'kill-this-buffer
  "q" 'quit-window-or-buffer
  "bs" 'bookmark-set
  "bl" 'counsel-bookmark
  "hf" 'counsel-describe-function
  "hv" 'counsel-describe-variable
  "dj" 'dumb-jump-go
  "db" 'dumb-jump-back
  "ll" 'toggle-truncate-lines
  "gg" 'maigt
  "cm" 'comment-line
  "xs" 'my-save-as-with-time
  "gbk" 'revert-buffer-with-gbk
  "rn" 'myrename-file-and-buffer
  "pwd" 'xah-copy-file-path
  "ru" 'quickrun-shell
)

;;org-mode
(evil-leader/set-key-for-mode 'org-mode "TAB" 'org-cycle)


(provide 'evil-init)
